<?php /* @var $this Controller */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="language" content="en"/>

    <!-- blueprint CSS framework -->
    <link href="<?php echo Yii::app()->request->baseUrl; ?>/css/bootstrap.css" rel="stylesheet"/>
    <!--[if lt IE 8]>
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css"
          media="screen, projection"/>
    <![endif]-->
    <style type="text/css">

        tbody th {
            background-color: #006DCC;
            color: white;
            font-family: sans-serif;
        }

        tr td:first-child,
        tr th:first-child {
            border-top-left-radius: 6px;
            border-bottom-left-radius: 6px;
        }

        tr td:last-child,
        tr th:last-child {
            border-top-right-radius: 6px;
            border-bottom-right-radius: 6px;
        }

        .nav > li.disabled.nav-header {
            cursor: default;
            font-size: 12px;
            font-weight: bold;
            text-transform: uppercase;
            height: 40px;
            background-color: red;
            padding: 10px 5px;
        }

        .active_menu {
            data-toggle = "tab";

        }
    </style>
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css"/>
    <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
    <script src="<?php echo Yii::app()->request->baseUrl; ?>/js/bootstrap.js"></script>
    <title><?php echo CHtml::encode($this->pageTitle); ?></title>
    <script>

        $(document).ready(function () {
            $('ul.nav.nav-pills.nav-justified li a').click(function () {
                $('ul.nav.nav-pills.nav-justified li').removeClass("active");
                $(this).parent().addClass('active');
            });
        });

    </script>
</head>

<body>
<div class="container">

    <div class="masthead">
        <div class="row">
            <div class="col-md-2"><h3 class="text-muted"><a href="<?php echo Yii::app()->request->baseUrl; ?>"><img
                            src="<?php echo Yii::app()->request->baseUrl; ?>/images/logo.png" alt="..." width="150px"/></a>
                </h3></div>
            <div class="col-md-10">
                <div class="row">
                    <div class="col-md-3">
                    </div>
                    <div class="col-md-9">
                        <ul class="nav nav-pills pull-right ">
                            <?php if (Yii::app()->user->isGuest) { ?>
                                <li><?php echo CHtml::link('Login', array('/user/login')); ?></li>
                                <li><?php echo CHtml::link('Register', array('/user/registration')); ?></li>
                            <?php } ?>
                            <?php if (!Yii::app()->user->isGuest) { ?>


                                <li><?php echo CHtml::link('My Profile', array('/user/profile', 'id' => Yii::app()->user->getId())); ?></li>
                                <?php  if ((!Yii::app()->user->isGuest) && (Yii::app()->user->getIsSuperuser() != 1)) {
                                    echo '<li>' . CHtml::link('Message', array('/site/message')) . '</li>';
                                    echo '<li>' . CHtml::link('Transaction', array('/site/transaction')) . '</li>';
                                    echo '<li>' . CHtml::link('Past Projects', array('/site/pastideality')) . '</li>';
                                }
                                ?>

                                <li><?php echo CHtml::link('logout', array('/user/logout')); ?></li>
                                <?php if (Yii::app()->user->getIsSuperuser() == 1)

                                    echo '<li>' . CHtml::link('Admin Panel', array('/Category/admin')) . '</li>';
                                ?>
                                <li class="disable active"><a href="#"
                                                              style="cursor:default;">MEMBER: <?php echo Yii::app()->user->name; ?></a>
                                </li>
                            <?php } ?>
                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <ul class="nav nav-pills nav-justified" id="menu_area">
            <?php if (Yii::app()->controller->action->id == 'index') {
                echo '<li class="active">';
            } else {
                echo '<li>';
            } ?><?php echo CHtml::link('Home', array('/')); ?> </li>
            <?php if (Yii::app()->controller->action->id == 'listideality') {
                echo '<li class="active">';
            } else {
                echo '<li>';
            } ?> <?php echo CHtml::link('Discover great projects', array('/site/listideality')); ?></li>
            <?php if (Yii::app()->controller->action->id == 'create' && Yii::app()->controller->id == 'ideality') {
                echo '<li class="active">';
            } else {
                echo '<li>';
            } ?> <?php echo CHtml::link('Advertise your project', array('/ideality/create')); ?></li>

        </ul>
    </div>

    <!-- Jumbotron -->
    <div class="main-content">
        <div id="content">
            <?php echo $content; ?>
        </div>
    </div>
    <!-- Site footer -->
    <div class="footer">
        <div class="row">
            <div class="col-md-6">
                <p>Copyright © 2014 Ideality. All rights reserved.</p>
            </div>
            <div class="col-md-6">
                <ul class="list-inline pull-right">
                    <li>Site Map</li>
                    <li>FAQ</li>
                    <li>Contact us</li>
                </ul>
            </div>
        </div>
    </div>
</div>
</body>
</html>
